home *** CD-ROM | disk | FTP | other *** search
- #include "controll.h"
- #include <iostream.h>
- #include <cstring.h>
-
- int main ()
- {
- /*
- //Use with ST2STATE.OMT and ST2HEAD1.SCT, ST2FUNC1.SCT, ST2HEAD2.SCT, and ST2FUNC2.SCT
- Controller controller1;
- try {
- controller1.process (turnOn);}
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
-
- try {
- controller1.process (turnOff); }
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
- return 0;
- */
-
- //Use with ST2STATE.OMT and ST2HEAD3.SCT and ST2FUNC3.SCT, ST2HEAD5.SCT, ST2FUNC5.SCT
- Controller controller1;
- try {
- controller1.turnOn (1); }
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
-
- try {
- controller1.turnOff (); }
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
-
- return 0;
- /*
- //Use with ST2STATE.OMT and ST2HEAD4.SCT and ST2FUNC4.SCT
- pOffState = new OffState();
- pOnState = new OnState();
- State *pCurrentState;
- pCurrentState = pOffState;
-
- try {
- pCurrentState = pCurrentState->turnOn(1); }
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
-
- try {
- pCurrentState = pCurrentState->turnOff(); }
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
-
- return 0;
- */
- /*
- //Use with ST2STATE.OMT and ST2HEAD5.SCT and ST2FUNC5.SCT
- Controller controller1;
- try {
- controller1.turnOn(1); }
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
-
- try {
- controller1.turnOff(); }
- catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
-
- return 0;
- */
- }
-